import {ref,reactive} from 'vue'
import {defineStore} from 'pinia'
import { repairManagementListGet, repairManagementPageGet} from '@/api/repairManagementApi.js';

export const useRepairManagementStore = defineStore('repairManagement', () => {

const repairManagementPage = ref([])
const repairManagementList = ref([])
const pagination = reactive({
    current:1,
    total:0
})

async function getRepairManagementPage(query = {}) {
let {records, current, total} =await repairManagementPageGet(query)
repairManagementPage.value = records
pagination.current = current
pagination.total = total
}

async function getRepairManagementList(query = {}) {
repairManagementList.value = await repairManagementListGet(query)
}


return {
pagination,
repairManagementPage, getRepairManagementPage,getRepairManagementList}
})
